//
//  TRWebBrower.swift
//  ThinkerRide
//
//  Created by sqkj on 2021/6/3.
//  Copyright © 2021 Chongqing Thinkerride Technology Co., Ltd. All rights reserved.
//

import UIKit

public class TRWebBrower: NSObject {
    public class func openURL(url:String,title:String = "") ->TRWebViewController{
        if url.hasPrefix("html://"){
            let fileName = url.replacingOccurrences(of: "html://", with: "")
            return TRWebViewController().initWithFileName(fileName: fileName,title: title)
        }else{
            return TRWebViewController().initWithURLStr(str: url,title: title)
        }
    }
    
    public class func openURL(URL:URL? = nil,title:String = "") ->TRWebViewController{
        if let url = URL {
            return TRWebViewController().initWithURL(url: url, title: title)
        }
        return TRWebViewController().initWithURLStr(str: "",title: title)
    }
}

